//
//  TTVLogService.h
//  TouchTV
//
//  Created by Wyman on 2017/9/1.
//  Copyright © 2017年 TouchTV. All rights reserved.
//

#import <Foundation/Foundation.h>

#define TTV_LOG_MACRO(level, fmt, ...)     [TTVLogger logLevel:level format:(fmt), ##__VA_ARGS__]
#define TTV_LOG_PRETTY(level, fmt, ...)    \
do {TTV_LOG_MACRO(level, @"%s [Line %d] " fmt, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);} while(0)

#define TTVLogError(fmt, ...)       TTV_LOG_PRETTY(TTVLogLevelError, fmt, ##__VA_ARGS__)
#define TTVLogWarn(fmt, ...)        TTV_LOG_PRETTY(TTVLogLevelWarn, fmt, ##__VA_ARGS__)
#define TTVLogInfo(fmt, ...)        TTV_LOG_PRETTY(TTVLogLevelInfo, fmt, ##__VA_ARGS__)
#define TTVLogDebug(fmt, ...)       TTV_LOG_PRETTY(TTVLogLevelDebug, fmt, ##__VA_ARGS__)
#define TTVLogVerbose(fmt, ...)     TTV_LOG_PRETTY(TTVLogLevelVerbose, fmt, ##__VA_ARGS__)
#define DLog(fmt, ...)              TTV_LOG_PRETTY(TTVLogLevelDebug, fmt, ##__VA_ARGS__)

typedef NS_ENUM(NSUInteger, TTVLogLevel) {
    TTVLogLevelError   = 1,
    TTVLogLevelWarn    = 2,
    TTVLogLevelInfo    = 3,
    TTVLogLevelDebug   = 4,
    TTVLogLevelVerbose = 5,
};

@interface TTVLogger : NSObject

+ (void)logLevel:(TTVLogLevel)level format:(NSString *)format, ...;

@end



